package com.soft.javase.day03.consolidation.statics;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/17
 */
public class StaticDemo {
    private String name;
    private static int count;

    public StaticDemo(String name) {
        this.name = name;
    }

    public void eat(){
        System.out.println(name+"正在吃饭");
    }

    public static void addCount(){
        count++;
        System.out.println(count);
    }

    static {
        System.out.println("静态代码块"+count);
    }

    {
        System.out.println("实例代码块"+count);
    }

}
